Passed
Pull Request — master (#37)
by Inumidun
01:42
created

index.js ➔ index   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
dl 0
loc 3
rs 10
nop 0
1
#! /usr/bin/env node
2
3
const ReactRaise = require('./lib/ReactRaise');
4
const speak = require('./lib/speak');
5
const argv = require('minimist')(process.argv.slice(2));
6
7
8
speak('React Raise', 'figlet');
9
speak(
10
  'Setup Information\n\tPlease answer the questions below to setup your app'
11
);
12
13
const app = new ReactRaise();
14
15
switch (argv._[0]) {
16
  case 'new':
17
    return (argv._[1] && argv._[1].length > 1) ?
18
      app.init(argv._[1]) :
19
      speak('ERROR: Invalid react app name', 'console', 'red');
20
  default:
21
    speak(
22
      `ERROR: Argument '${argv._[0]}' is not a valid argument. Use 'new' instead`,
23
      'console',
24
      'red'
25
      );
26
}
27
28